home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: delta / whiteline CD Series - delta.iso / tools / utils / smc_tt1 / driver.h < prev    next >
Text File  |  1995-11-25  |  3KB  |  85 lines

  1. #define FALSE    0
  2. #define TRUE    1
  3.  
  4. #define PKTCOOKIE    0x5f504b54L            /* "_PKT" */
  5.  
  6. #define ET_IP    0x800
  7. #define ET_ARP    0x806
  8. #define ET_RARP    0x8035
  9.  
  10.  
  11. #define NETRESET        0
  12. #define NETOPEN            1
  13. #define NETRELEASE        2
  14. #define NETSEND            3
  15. #define NETGETADR        4
  16. #define NETINFO            5
  17. #define NETPKTALLOC        6
  18. #define NETPKTFREE        7
  19. #define NETCONFIG        8
  20.  
  21. /*---------------------------------------------------------------*/
  22. /* Fehlermeldungen                                               */
  23. /*---------------------------------------------------------------*/
  24. #define EPROTAVAIL        -1
  25. #define EPROTUSED        -2     /* Protokoll wird bereits benutzt */
  26. #define EHANDLE            -3
  27. #define EPROTBUSY        -4     /* Protokoll im Gebrauch          */
  28. #define EINIT            -5     /* Fehler beim Initialisieren     */
  29. #define EPARAM            -6     /* unzulaessige Parameter         */
  30. #define EPKTLEN            -7     /* ungueltige Paketlaenge         */
  31. #define ECOLLISION        -8     /* Kollision festgestellt         */
  32. #define ETIMEOUT        -9     /* Timeout beim warten auf Pakete */
  33.  
  34. #define MAXPROTOCOLS    4      /* Anzahl installierbarer Protok. */
  35. #define ET_UNUSED        0
  36. #define ET_FREE            -1
  37.  
  38. #define MAXPKT            30     /* Anzahl Pakete im Ringpuffer    */
  39.  
  40. /*---------------------------------------------------------------*/
  41. /* Typen                                                         */
  42. /*---------------------------------------------------------------*/
  43. typedef int (*procref)();
  44. typedef int HANDLE;
  45. typedef int(*pkt_hndl)(int,char *); /* type of upcall function */
  46.  
  47. typedef struct
  48. {
  49.     long    st_sent;
  50.     long    st_xmiterr;
  51.     long    st_collision;
  52.     long    st_got;
  53.     long    st_received;
  54.     long    st_missed;
  55.     long    st_crc;
  56.     int        st_err;
  57.     int        st_free;
  58.     long    st_intr;
  59.     long    st_magic;    /* hier steht 0x12344321, wenn das naechste Feld gueltig ist */
  60.     long    st_type;     /* Art der Schnittstelle (1=SLIP) */
  61. } et_stat;
  62.  
  63. typedef struct
  64. {
  65.     unsigned int type;
  66.     int (*handler)(int,lan_buffer_typ *);
  67.     unsigned int recvd;
  68.     unsigned int sent;
  69. } PROTOCOL;
  70.  
  71. /*---------------------------------------------------------------*/
  72. /* Prototypen                                                    */
  73. /*---------------------------------------------------------------*/
  74. int net_info(int, et_stat *);
  75. int net_open(int, int (*)(int,lan_buffer_typ *));
  76. int net_release(int);
  77. int net_send(int, lan_buffer_typ *);
  78. int    net_getadr(int,unsigned char *);
  79. int net_reset(void);
  80. lan_buffer_typ *net_pktalloc(unsigned short);
  81. int net_pktfree(lan_buffer_typ *);
  82. int net_config(int);
  83.  
  84. int net_init(void);
  85.